package troopmanager.mooresr.us;


public class EventParticipant implements Comparable<EventParticipant> {
	private Person person;
	private Integer eventId;
	private Boolean paid;
	private Boolean permissionSlip;

	public EventParticipant() {
		
	}


	public EventParticipant(Integer eventId, Person p) {
		this.person = p;
		this.eventId = eventId;
		this.paid = false;
		this.permissionSlip = false;
	}

	public Integer getEventId() {
		return eventId;
	}

	public void setEventId(Integer eventId) {
		this.eventId = eventId;
	}

	public Person getPerson() {
		return person;
	}

	public void setPerson(Person person) {
		this.person = person;
	}

	public Boolean getPaid() {
		return paid;
	}

	public void setPaid(Boolean paid) {
		this.paid = paid;
	}

	public Boolean getPermissionSlip() {
		return permissionSlip;
	}

	public void setPermissionSlip(Boolean permissionSlip) {
		this.permissionSlip = permissionSlip;
	}

	@Override
	public int compareTo(EventParticipant arg0) {
		String thisName = getPerson().getLastName() + getPerson().getFirstName();
		String otherName = arg0.getPerson().getLastName() + arg0.getPerson().getFirstName();
		
		return thisName.compareTo(otherName);
	}
	
	public String toString() {
		return getPerson().getFirstName() + " " + getPerson().getLastName();
	}
	
	
}
